package DAL;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class connectDatabase {
    public Connection connect(){
        String path="src/configuration/sequential_query.properties";

        Properties properties=new Properties();
        try  {
            FileInputStream fileInputStream = new FileInputStream(path);
            properties.load(fileInputStream);
            Connection connection = DriverManager.getConnection(properties.getProperty("mysqlLogin"), properties.getProperty("mysqlUser"), properties.getProperty("mysqlPwd"));
            return connection;
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException es) {
            es.printStackTrace();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        return null;
    }
}
